home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / t3_1 / vaxt.lha / vaxt / tsystem / unvaxbuild.t < prev    next >
Text File  |  1988-02-10  |  5KB  |  146 lines

  1. (herald unvaxbuild)
  2. #|
  3.  
  4. To build a new system from sources:
  5.  
  6. 1. You should be in a directory with sources and tsystem as subdirectories
  7.    Execute the shell script in tsystem/envset
  8. 2. Start up tsystem/xt and load this file into orbit-env
  9. 3. (compile-support) and (exit)
  10. 4. Start up tsystem/xt again and load this file into orbit-env
  11. 5. (compile-sources) and (link-t '(tsystem new)) and (exit)
  12. 6. cd tsystem; linkt new.o new; cd ..
  13. 7. tsystem/new is a T without compiler. Start up new with a large heap.
  14. 8. ((*value t-implementation-env 'load-and-suspend-system) '(tsystem new) t)
  15.    (exit)
  16. 9. cd tsystem; linkt new.o new    That's it.
  17.  
  18. |#
  19.  
  20. ;;; Build compiler early binding environment
  21.  
  22. (*define user-env 'compile-support
  23. (lambda ()     
  24. (create-support '(t3_primops vconstants) '(t3_primops vconstants))
  25. (load '(t3_primops vconstants t) orbit-env)
  26. (orbit-vax-setup 't3_primops)
  27. (orbit-init 'base)
  28. (set (orbit-syntax-table) primop-syntax-table)
  29. (set *compile-primops?* nil)
  30. (create-support '(t3_primops vaxprimops)   '(t3_primops vaxprimops))
  31. (create-support '(t3_primops vaxarith)     '(t3_primops vaxarith))
  32. (create-support '(t3_primops locations)    '(t3_primops locations))
  33. (create-support '(t3_primops vaxlow)       '(t3_primops vaxlow))
  34. (create-support '(t3_primops predicates)       '(t3_primops predicates))
  35. (orbit-init 'base  
  36.             'constants 'primops 'arith 'locations 'low 'predicates)
  37. (create-support '(t3_primops open)    '(t3_primops open))
  38. (create-support '(t3_primops aliases) '(t3_primops aliases))
  39. (create-support '(t3_primops carcdr)  '(t3_primops carcdr))
  40. (create-support '(t3_primops genarith)  '(t3_primops genarith))))
  41.  
  42. ;;; compile compiler code in early binding environment, runtime system
  43.  
  44. (*define user-env 'compile-sources
  45. (lambda ()
  46. (set (orbit-syntax-table) primop-syntax-table)
  47. (comfile '(t3_primops base))
  48. (compile-primop-source '(t3_primops vaxprimops   vi))
  49. (compile-primop-source '(t3_primops vaxarith     vi))
  50. (compile-primop-source '(t3_primops locations    vi))
  51. (compile-primop-source '(t3_primops vaxlow       vi))
  52. (compile-primop-source '(t3_primops genarith    vi))
  53. (set *compile-primops?* nil)
  54. (set (table-entry *modules* 'bignum) '(osys vax_bignum))
  55. (load-quietly '(t3_primops vconstants t) orbit-env)
  56. (set (orbit-syntax-table) (env-syntax-table t-implementation-env))
  57. (orbit-vax-init 't3_primops)
  58. (define (comsys system . start)
  59.   (walk (lambda (file)
  60.       (xcase (car file)
  61.             ((osys)
  62.          (set (tc-syntax-table) (env-syntax-table t-implementation-env))
  63.          (comfile file))
  64.         ((t3_primops)
  65.          (set (tc-syntax-table) primop-syntax-table)
  66.          (bind ((write-support-file false))
  67.            (comfile file)))))
  68.     (let ((files (xcase system
  69.                ((z) *zvm-system*)
  70.                ((t) *t-system*))))
  71.       (if start (mem alikev? (car start) files) files))))
  72. (load '(osys unvax_files) orbit-env)
  73. (comsys 't)
  74. (comfile '(link defs))
  75. (comfile '(link linker))
  76. (comfile '(link unvax_link))
  77. (comfile '(link lp_table))
  78. (comfile '(link suspend))
  79. (comfile '(link unvaxsuspend))
  80. (comfile '(tscheme scheme))
  81. (comfile '(tscheme syntax))
  82. (comfile '(tscheme system))
  83. (comfile '(tscheme runtime))
  84. (comfile '(tscheme compiler))
  85. (set (tc-syntax-table) (env-syntax-table orbit-env))
  86. (walk (lambda (x) (load x orbit-env))
  87.           '((assembler expand)
  88.                 (assembler fg_spec)  
  89.         (assembler fg_expr)  
  90.         (assembler as_syntax)))
  91. (walk comfile
  92.       (append *orbit-files*
  93.           *top-files*
  94.           *front-files*
  95.           *back-end-files*
  96.           *orbit-vax-files*
  97.           '((assembler ib)
  98.         (assembler as_open) 
  99.         (assembler fg)
  100.         (assembler lap)
  101.         (assembler as_utils)
  102.         (assembler as)      
  103.         (assembler count)
  104.         (assembler mark)
  105.         (assembler bits)
  106.         (assembler listing)
  107.         (back_end unvaxgen))
  108.           *tas-vax-files*))))
  109.  
  110. (define (load-linker . system)
  111.   (let* ((system (if (null? system) 
  112.                      ((*value t-implementation-env 'machine-type) 
  113.                       ((*value t-implementation-env 'local-machine)))
  114.                      (car system)))
  115.          (link-env (make-locale orbit-env 'link-env)))
  116.     (*define standard-env 'link-env link-env)
  117.     (load '(link defs )         link-env)
  118.     (load '(link linker )       link-env)
  119.     (load 
  120.      (case system
  121.        ((aegis) '(link aegis_link ))
  122.        ((sun)   '(link sun_link ))
  123.        ((hp)    '(link hp_link ))
  124.        ((vax)   '(link unvax_link ))
  125.        ((mac)    '(link mac_link))
  126.        (else    (error "unknown system - ~a" system)))
  127.      link-env)
  128.     (load
  129.      (case system
  130.        ((vax) '(t3_primops vconstants t)) 
  131.        (else '(t3_primops mconstants t)))
  132.      link-env)
  133.     (*define standard-env  'link
  134.          (lambda (files outfile)
  135.            (set (repl-results) nil)
  136.            (gc)
  137.            ((*value link-env 'link) files outfile)))))
  138.  
  139. (*define user-env 'link-t
  140. (lambda (file)
  141. (load-linker)
  142. (load '(osys unvax_files) orbit-env)
  143. (link *t-system* file)))
  144.  
  145.  
  146.